<?php
require_once 'includes/config.php';
if(!empty($_POST['submit']))
{
$username=$_POST['username'];
$sqlSelUsr="SELECT user_id FROM tbl_users WHERE 
      		email='$username' and status =1";
$rstSelUsr=mysql_query($sqlSelUsr);
$noSelUsr=mysql_num_rows($rstSelUsr);
if($noSelUsr>0)
{
$rowSelUsr=mysql_fetch_array($rstSelUsr);
$_SESSION['userIdForgotUsernameSess']=$rowSelUsr['user_id'];
header("Location:index.php?forgotUsernameConfirm");
}
else
	$msg = "<font face=verdana size=2 color='#FF0000'><b>Please enter your Swapen Email to retrieve your Username.</b></font>";
}
?>
<div id='panel'>
  <div class="fulldiv" style="width:700px;">

 <div class="fulldiv" style="margin:10px 0px 0px 0px;">
	
<div style="float:left; margin:0px 10px 0px 10px;"><strong class="orangehead">Confirm your identity to reset Username </strong></div>

<div class="fullbox_top">&nbsp;</div>
<div class="fullbox_repeat">
  
<form name="frmForgotPassword" id="frmForgotPassword" method="post" action="<?php echo $_SERVER['php_self']?> " onsubmit="return validateForgotUsername()">
<input type="hidden" name="forgotPasswordKey" id="forgotPasswordKey" />
<table width="100%" border="0" class="contentForm"  cellpadding="0" cellspacing="0">
  <tr>
    <td width="35%" class="contentHeader">&nbsp;</td>
  </tr>
  <tr>
    <td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
    <td  height="10"></td>
  </tr>
  <tr>
    <td width="2%"></td>
    <td width="98%"  height="16"><div id="messageArea"><?php if(isset($msg))
	echo "<b>".$msg."</b>";
										
		?></div></td>
  </tr>
  <tr>
    <td></td>
    <td  height="10"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
       <div>
        <div id="lblUsername" style="float:left;padding:10px;"><strong>Your Email Address :</strong></div>
        <div style="float:left;padding:10px;"><input type="text" name="username" id="username" class="inputbg"></div>
	<div style="float:left;padding:10px; padding-top:7px;"><input type="submit" name="submit" id="submit" value="Continue" class="sbmt_btn" /></div>
      </div>
      </td>
  </tr>
  <tr>
    <td></td>
    <td  height="10"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp</td>
  </tr>
  <tr>
    <td></td>
    <td  height="10"></td>
  </tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<div class="fullbox_bot">&nbsp;</div>

</div>

</div>
<br />